import Taro from '@tarojs/taro'
import { Provider } from '@tarojs/redux'

import 'taro-ui/dist/style/components/search-bar.scss'
import 'taro-ui/dist/style/components/button.scss'
import 'taro-ui/dist/style/components/icon.scss'
import 'taro-ui/dist/style/components/tabs.scss'
import 'taro-ui/dist/style/components/modal.scss'
import 'taro-ui/dist/style/components/noticebar.scss'
import 'taro-ui/dist/style/components/activity-indicator.scss'
import 'taro-ui/dist/style/components/loading.scss'
import 'taro-ui/dist/style/components/float-layout.scss'

import './app.less'

// 如果需要在 h5 环境中开启 React Devtools
// 取消以下注释：
// if (process.env.NODE_ENV !== 'production' && process.env.TARO_ENV === 'h5')  {
//   require('nerv-devtools')
// }

class App extends Taro.Component {
  config = {
    pages: [
      'pages/home/index',
      'pages/profile/changePhone',
      'pages/profile/index',
      'pages/memberInfo/index',
      'pages/login/index',
      'pages/transaction/index',
      // 'pages/saleRecord/index',
      // 'pages/login/authName',
      // 'pages/login/authBankCard'
    ],
    subpackages: [
      {
        root: 'pages/myMember',
        pages: [
          'index',
          'addMember'
        ]
      },
      {
        root: 'pages/partner',
        pages: [
          'index',
          'baseInfo',
          'addPartner'
        ]
      },
      {
        root: 'pages/order',
        pages: [
          'index',
          'detail'
        ]
      }
    ],
    window: {
      navigationBarBackgroundColor: '#fff',
      navigationBarTextStyle: 'black',
      onReachBottomDistance: 0
    }
  }

  // 在 App 类中的 render() 函数没有实际作用
  // 请勿修改此函数
  render () {}
}

import store from './store'

Taro.render(
  <Provider store={ store }>
    <App />
  </Provider>,
  document.getElementById('app')
)